/*
 * @Author: 谢小康 2170673706@qq.com
 * @Date: 2023-12-27 19:33:59
 * @LastEditors: 谢小康 2170673706@qq.com
 * @LastEditTime: 2024-01-30 14:11:53
 * @FilePath: \My-bolg\server\router\shuoshuo.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
const express = require('express');
const router = express.Router();
const {
    addshuoshuo,
    uploadshuoshuoimg,
    getshuoshuo,
    gettop,
    getshuoshuoByid,
    editshuoshuo,
    updatashuoshuoimg,
    updatacover,
    cantop,
    updatatop,
    tovisible,
    todelete,
    addstrs
} = require('../controller/shuoshuo.js');
const {verifyshuoshuoParam,verifyshuoshuoByid} =require("../middleware/shuoshuo.js")
const {isSuperAdmin} = require('../controller/user.js')
const { auth } = require('../util/user');
/* 添加说说 */
router.post('/addshuoshuo',auth,isSuperAdmin,verifyshuoshuoParam,addshuoshuo);
/* 上传说说的图片 */
router.post('/uploadshuoshuoimg',auth,isSuperAdmin,verifyshuoshuoByid,uploadshuoshuoimg);
/* 分页获取说说 */
router.post('/getshuoshuo',getshuoshuo);
/* 获取置顶说说 */
router.get('/gettopshuoshuo',gettop);
/* 获取单个说说 */
router.get("/getshuoshuobyid",auth,getshuoshuoByid)
/* 编辑说说 */
router.post('/editshuoshuo',auth,isSuperAdmin,editshuoshuo);
/* 修改说说的图片 */
router.post('/updatashuoshuoimg',auth,isSuperAdmin,updatashuoshuoimg);
/* 修改封面 */
router.post("/updatacover",auth,isSuperAdmin,updatacover)
/* 查看你能否置顶 */
router.get("/cantop",auth,isSuperAdmin,cantop)
/* 修改置顶 */
router.post("/updatatop",auth,isSuperAdmin,updatatop)
/* 修改是否公开 */
router.post("/tovisible",auth,isSuperAdmin,tovisible)
/* 删除说说 */
router.post("/todelete",auth,isSuperAdmin,todelete)
/* 点赞说说 */
router.post("/addstrs",addstrs)
module.exports = router;